package demo;

import java.util.Scanner;

public class CCpractise {
    //找素数
    public static void main(String[] args) {
//输出101~200之间的素数
        Scanner sc=new Scanner(System.in);
        System.out.println("请输入区间最小数：");
        int numberMin=sc.nextInt();
        System.out.println("请输入区间最大数：");
        int numberMax= sc.nextInt();
        System.out.println("所有素数为：");
        for (int i = numberMin; i <=numberMax; i++) {
            for (int j = 2; j <=(numberMax+numberMin)/2 ; j++) {
                if(i%j==0)
                    break;
                else {
                    System.out.println(i);
                    break;
                }
            }
        }
    }
}
